﻿<navigation:Page x:Class="DemoDataGridToolBar.Views.LocalData" 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
					 xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"						 
 					 xmlns:mac="clr-namespace:System.Windows.Controls;assembly=Slma.Windows.Controls"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           d:DesignWidth="640" d:DesignHeight="480"
           Title="LocalData Page">
    <Grid x:Name="LayoutRoot">
	
			<StackPanel Orientation="Vertical" Margin="0,20,0,0" Width="800">

			<mac:DataGridToolBar  
        Height="45" Margin="0,0,0,2" ButtonAddNewVisible="True" ButtonEditVisible="True"
				
				DataGrid="{ Binding ElementName=dgProducts, Mode=OneTime}"	
				CreateDataForm="DataGridToolBar_CreateDataForm"										
				>
				<mac:DataGridToolBar.ColumnsForFiltering>
					<mac:DataGridToolBarFilterItem ColumnName="Name"  />
					<mac:DataGridToolBarFilterItem ColumnName="ProductNumber"  />
					<mac:DataGridToolBarFilterItem ColumnName="Color"  />
					<mac:DataGridToolBarFilterItem ColumnName="Weight"  />
					<mac:DataGridToolBarFilterItem ColumnName="SellStartDate"  />
				</mac:DataGridToolBar.ColumnsForFiltering>
			</mac:DataGridToolBar>


			<mac:maDataGrid x:Name="dgProducts" AutoGenerateColumns="False" Height="340"	  >
				<data:DataGrid.Columns>
					<data:DataGridTextColumn Header="{StaticResource ls_product_name}" Width="150" MaxWidth="300" MinWidth="40" 
						Binding="{Binding Name}" SortMemberPath="Name" CanUserSort="True">
					</data:DataGridTextColumn>
					<data:DataGridTextColumn Header="{StaticResource ls_product_poductnumber}"  Width="100" MaxWidth="300" MinWidth="40"
						Binding="{Binding ProductNumber}" SortMemberPath="ProductNumber" CanUserSort="True" />
					<data:DataGridTextColumn Header="{StaticResource ls_product_color}"  Width="100" MaxWidth="300" MinWidth="30" 
						Binding="{Binding Color, Mode=TwoWay}" SortMemberPath="Color" CanUserSort="True"/>
					<data:DataGridTextColumn Header="{StaticResource ls_product_weight}"  Width="100" MaxWidth="300" MinWidth="30" 
						Binding="{Binding Weight}" SortMemberPath="Weight" CanUserSort="True"/>
					<data:DataGridTextColumn Header="{StaticResource ls_product_sellstartdate}"  Width="150" MaxWidth="300" MinWidth="100" 
						Binding="{Binding SellStartDate,StringFormat=dd.MM.yyyy }" SortMemberPath="SellStartDate" CanUserSort="True"/>
				</data:DataGrid.Columns>
			</mac:maDataGrid>

		</StackPanel>

	</Grid>
</navigation:Page>
